home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 701-725 / 709 / planets / range.c < prev    next >
Text File  |  1995-03-18  |  676b  |  18 lines

  1. /*******************************************************************************
  2. ** We want to stay inside the first turn of the circle, so we want that       **
  3. **    0 deg <= val < 360 deg.                                                 **
  4. ** This is a combination of the old range-routine in planet and the adj360-   **
  5. ** routine in moonphase.                                                      **
  6. *******************************************************************************/
  7. double range(val)
  8. double val;
  9.    {
  10.    do {
  11.       if(val<0.)
  12.          val += 360.;
  13.       else if(val>=360.)
  14.          val -= 360.;
  15.       } while(val < 0. || val >= 360.);
  16.    return(val);
  17.    }
  18.